DigiLocker Credentials API
The following document highlights the details of the DigiLocker Credentials API.
API Description
Objective
The DigiLocker Credentials API stores the Client ID and Client secret that you procure through DigiLocker in HyperVerge's database, and enables you to store these credentials for the first time or update them for existing records.
For steps on procuring DigiLocker credentials (Client ID and Client Secret), refer to the DigiLocker credentials procurement guide.
| Input | Output |
|---|---|
| The client ID and key generated on DigiLocker while creating the partner's account | A success message |
API URL
https://ind-verify.hyperverge.co/api/digilocker/updateCredentials
API Endpoint
updateCredentials
Overview
The DigiLocker Credentials API is RESTful and uses standard HTTP verbs and status codes. The responses are in JSON format and you should send the request payload as JSON through a POST request.
Method - POST
Authentication
You need a unique pair of application ID ( appId ) and application key ( appKey ) from HyperVerge to verify your identity for accessing the API.
Headers
| Header | Mandatory / Optional | Description | Input Format |
|---|---|---|---|
| content-type | Mandatory | This parameter defines the media type for the request payload | application/json |
| appId | Mandatory | The application identifier shared by HyperVerge. You can find the details in the dashboard's credentials tab | This should be a unique value |
| appKey | Mandatory | The application key shared by HyperVerge. You can find the details in the dashboard's credentials tab | This should be a unique value |
| transactionId | Optional | A unique identifier for tracking a user journey | This should be both unique and easily associated with the user's journey in your application(s) |
Inputs
The following table provides the details of the parameters required for the DigiLocker Credentials API's request body:
| Parameter | Mandatory / Optional | Type | Description | Input Format | Default Value |
|---|---|---|---|---|---|
clientId | Mandatory | string | The client ID generated on DigiLocker partner's account | Not Applicable | Not Applicable |
clientSecret | Mandatory | string | The client key generated on DigiLocker partner's account | Not Applicable | Not Applicable |
Request
The following code snippet demonstrates a standard curl request for the DigiLocker Credentials API:
curl --location --request POST 'https://ind-verify.hyperverge.co/api/digilocker/updateCredentials' \
--header 'Content-Type: application/json' \
--header 'appId: <Enter_the_HyperVerge_appId>' \
--header 'appKey: <Enter_the_HyperVerge_appKey>' \
--header 'transactionId: <Enter_the_transactionId>' \
--data-raw '{
"clientId": "<Enter_the_client_ID>",
"clientSecret": "<Enter_the_client_key>"
}'
Success Response
The following code snippet demonstrates a success response from the DigiLocker Credentials API:
{
"status": "success",
"statusCode": "200",
"result": {
"DigiLocker": {
"clientId": "<The_Shared_clientId>",
"clientSecret": "<The_Shared_clientKey>"
}
}
}
Success Response Details
The following table outlines the details of the success response from the DigiLocker Credentials API:
| Parameter | Type | Description |
|---|---|---|
status | string | The status of the request |
statusCode | string | The HTTP status code for the response |
result | object | The JSON object containing the DigiLocker credentials |
result.DigiLocker | object | The DigiLocker object containing the stored credential details |
result.DigiLocker.clientId | string | The client ID that was stored in HyperVerge's database |
result.DigiLocker.clientSecret | string | The client secret that was stored in HyperVerge's database |
Error Responses
The following are some error responses from the DigiLocker Credentials API:
- Missing or Invalid Credentials
- Server Error
{
"status": "failure",
"statusCode": "401",
"error": "Missing/Invalid credentials"
}
{
"status": "failure",
"statusCode": "500",
"error": {
"code": "ER_SERVER",
"message": "Something went wrong"
}
}
Error Response Details
A failure or error response contains a failure status with a relevant status code and error message.
The following table lists all error responses:
| Status Code | Error Message | Error Description | Error Resolution |
|---|---|---|---|
| 401 | Missing/Invalid credentials | The request is either missing the mandatory appId and appKey combination or has invalid values | Provide valid appId and appKey credentials in the request |
| 404 | Not Found | Requested resource could not be found | Enter the valid Client ID and/or Client Secret in the request |
| 500 | Internal Server Error | There was an error with HyperVerge's server | Please check the request headers or contact the HyperVerge team for resolution |